package exceptionsmy;

//: exceptions/AlwaysFinally.java
// Finally is always executed.
import static net.mindview.util.Print.print;

class FourException extends Exception {
	private static final long serialVersionUID = -6415283681596493112L;
}

public class AlwaysFinally {
	public static void main(String[] args) {
		print("Entering first try block");
		try {
			print("Entering second try block");
			try {
				throw new FourException();
			} finally {
				print("finally in 2nd try block");
			}
		} catch (FourException e) {
			System.out.println("Caught FourException in 1st try block");
		} finally {
			System.out.println("finally in 1st try block");
		}
	}
} /*
	 * Output: Entering first try block Entering second try block finally in 2nd
	 * try block Caught FourException in 1st try block finally in 1st try block
	 */// :~
